﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Entity;

public partial class admin_layout_navigator : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login"] != null)
        {
            Admin admin = (Admin)Session["login"];
            string str = "";

            if (admin.Level == 0)
            {
                str += "<ul class='nav left sf-js-enabled' style='display: block;'>";
                str += "<li id='dashboard'><a  href='../Pages/Index.aspx' class='top'>Home</a></li>";

                str += "<li class='' id='router'>";
                str += "<a class='top' href=\"../Pages/CustomerList.aspx\">Customer</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/FeedBackList.aspx'>FeedBack List</a></li>";
                str += "<li><a href='../Pages/OrderBillList.aspx'>OrderBill List</a></li>";
                str += "</ul>";
                str += "</li>";
                str += "<li class='' id='sale'>";
                str += "<a class='top' href=\"../Pages/ImageList.aspx\">Image Management</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/SizeAdd.aspx'>Add New Size</a></li>";
                str += "<li><a href='../Pages/SizeList.aspx'>Size List</a></li>";
                str += "<li><a href='../Pages/PaymentMethodList.aspx'>Payment Method List</a></li>";
                str += "</ul>";
                str += "</li>";

                str += "<li class='' id='reports'>";
                str += "<a class='top' href=\"../Pages/AdminList.aspx\">Admin</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/AdminAdd.aspx'>Add New Admin</a></li>";
                str += "</ul>";
                str += "</li>";
                str += "<li class='' id='new'>";
                str += "<a class='top' href=\"#\">Statistic</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/OrderStatistic.aspx'>Order Statistic</a></li>";
                str += "</ul>";
                str += "</li>";
                str += "<li class='' id='system'>";
                str += "<a class='top' href=\"../Pages/FileManager.aspx\">File Management</a>";
                str += "</li>";
                str += "</ul>";
            }
            else
            {
                str += "<ul class='nav left sf-js-enabled' style='display: block;'>";
                str += "<li id='dashboard'><a  href='../Pages/Index.aspx' class='top'>Home</a></li>";

                str += "<li class='' id='router'>";
                str += "<a class='top' href=\"../Pages/CustomerList.aspx\">Customer</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/FeedBackList.aspx'>FeedBack List</a></li>";
                str += "<li><a href='../Pages/OrderBillList.aspx'>OrderBill List</a></li>";
                str += "</ul>";
                str += "</li>";
                str += "<li class='' id='sale'>";
                str += "<a class='top' href=\"../Pages/ImageList.aspx\">Image Management</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/SizeAdd.aspx'>Add New Size</a></li>";
                str += "<li><a href='../Pages/SizeList.aspx'>Size List</a></li>";
                str += "<li><a href='../Pages/PaymentMethodList.aspx'>Payment Method List</a></li>";
                str += "</ul>";
                str += "</li>";

                str += "<li class='' id='reports'>";
                str += "<a class='top' href=\"../Pages/AdminList.aspx\">Admin</a>";
                str += "</li>";
                str += "<li class='' id='new'>";
                str += "<a class='top' href=\"#\">Statistic</a>";
                str += "<ul style='display: none; visibility: hidden;'>";
                str += "<li><a href='../Pages/OrderStatistic.aspx'>Order Statistic</a></li>";
                str += "</ul>";
                str += "</li>";
                str += "</ul>";
            }
            ltlNav.Text = str;
        }
        
    }

    protected void lnkLogout_Click(object sender, EventArgs e)
    {
        if (Session["login"] != null)
        {
            Session["login"] = null;
            Response.Redirect("../Login.aspx");
        }
        else
        {
            Response.Redirect("../Login.aspx");
        }
    }
}
